package io.renren.modules.generator.service.impl;

import org.springframework.stereotype.Service;
import java.util.Map;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import io.renren.common.utils.PageUtils;
import io.renren.common.utils.Query;

import io.renren.modules.generator.dao.OutOrderDao;
import io.renren.modules.generator.entity.OutOrderEntity;
import io.renren.modules.generator.service.OutOrderService;


@Service("outOrderService")
public class OutOrderServiceImpl extends ServiceImpl<OutOrderDao, OutOrderEntity> implements OutOrderService {

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        Page<OutOrderEntity> page = this.selectPage(
                new Query<OutOrderEntity>(params).getPage(),
                new EntityWrapper<OutOrderEntity>().like(params.containsKey("orderNo"), "order_no", params.get("orderNo") + "").orderBy("order_no", false)
        );

        return new PageUtils(page);
    }

}
